/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.portlet.editor.model.portlet.impl;

/**
 * A hole model.
 */
public class HoleModel
{

  /**
   * The hole name.
   */
  private String name = null;

  /**
   * The hole value.
   */
  private String value = null;



  /**
   * Constructor.
   * 
   * @param name
   *          the hole name.
   * @param value
   *          the hole value.
   */
  public HoleModel(String name, String value)
  {
    super();
    this.name = name;
    this.value = value;
  }



  /**
   * Get the hole name.
   * 
   * @return the hole name.
   */
  public String getName()
  {
    return this.name;
  }



  /**
   * Set the hole name.
   * 
   * @param name
   *          the hole name.
   */
  public void setName(String name)
  {
    this.name = name;
  }



  /**
   * Get the hole value.
   * 
   * @return the hole value.
   */
  public String getValue()
  {
    return this.value;
  }



  /**
   * Set the hole value.
   * 
   * @param value
   *          the hole value.
   */
  public void setValue(String value)
  {
    this.value = value;
  }



  /**
   * Check whether the hole value is valid.
   * 
   * @return whether the hole value is valid.
   */
  public boolean accept()
  {
    boolean isOK = true;
    if (this.getValue() == null || this.getValue().trim().length() == 0) {
      isOK = false;
    }
    return isOK;
  }

}
